use "C:\Users\karti\Documents\Data\regressions\paper_2\data_corrected_for_regs.dta", clear

merge m:1 new_state_dist_code round using "C:\Users\karti\Documents\Data\regressions\paper_2\data_02_21_all_round_districts.dta"
keep if _m==3
drop _m


keep if year<=2005

gen r = (rice_prop_FCI_produced>0)
gen w = (wheat_prop_FCI_produced>0)

gen fci_tot = (r==1 | w==1)


egen tr = group(yr_qtr)



tab new_state_dist_code, gen(nssdist)
gen t2 =  time - 1
forvalues j = 1/150 {
*linear
gen nssdist_`j'=nssdist`j'*t2
}


gen t = tr*marketing_reform


gen triple_p = t*fci_tot
gen dum2_1 = fci_tot * marketing_reform
gen fci_year = fci_tot * tr


areg log_real_agwage t marketing_reform i.yr_qtr nssdist_* [aweight=weight], cluster(new_state_dist_code) absorb(new_state_dist_code)
outreg2 using parallel_AGINCOME.xls, replace  ctitle("") keep(t fci_tot marketing_reform) addtext(District FE, YES, Year Quarter FE, YES, District Level Linear Time Trend, YES) nocons


areg log_real_agwage triple_p dum2_1 fci_year fci_tot t marketing_reform i.yr_qtr nssdist_* [aweight=weight], cluster(new_state_dist_code) absorb(new_state_dist_code)
outreg2 using parallel_AGINCOME.xls, append ctitle("") keep(triple_p dum2_1 fci_year fci_tot marketing_reform t) addtext(District FE, YES, Year Quarter FE, YES, District Level Linear Time Trend, YES) nocons




/*

















******************************************************************************************************************

